<?php

namespace App\Modules\Admin\Http\Requests\Expenses;

use App\Modules\Admin\Entities\Expenses\CouponReceiveModel;
use App\Modules\Admin\Http\Requests\BaseRequest;

class CouponReceiveRequest extends BaseRequest
{
    public function setInstance()
    {
        $this->instance = CouponReceiveModel::getInstance();
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'   => ['required'],
            'type'   => ['required'],
            'value'   => ['required'],
            'valid_type'   => ['required'],
            'start_time'   => ['required'],
            'end_time'   => ['required'],
            'valid_days'   => ['required'],
            'status'   => ['required']
        ];
    }

    public function messages()
    {
        return [
            'title.required' => '请输入卡券名称！',
            'type.required' => '请选择卡券类型！',
            'value.required' => '请输入卡券面值！',
            'valid_type.required' => '请选择有效期时间类型！',
            'start_time.required' => '请选择有效期时间！',
            'end_time.required' => '请选择有效期时间！',
            'valid_days.required' => '请输入有效天数！',
        ];
    }
}
